<template>
	<view class="page" :style="themeColor">
		<view class="flex benben-position-layout flex flex-wrap align-center payChangecode_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub payChangecode_fd0_0'>
				<view class='flex flex-wrap align-center'>
					<person></person>
				</view>
				<view class='flex flex-wrap align-stretch justify-center flex-sub'>
					<text class='payChangecode_fd0_0_c1_c0'>修改支付密码</text>
				</view>
				<view class='flex flex-wrap align-center payChangecode_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view style="padding: 8rpx 32rpx;">
			<back></back>
		</view>
		<!---验证码flex布局开始-->
		<view class="flex flex-direction align-center benben-flex-layout payChangecode_flex_1">
			<text class='payChangecode_fd1_0'>我们要对您绑定的手机号进行验证：</text>
			<text class='payChangecode_fd1_1'>{{phone1}}</text>
		</view>

		<!---验证码flex布局结束-->
		<benben-digital-password v-model='code' :box-num='6' mode='number'
			class-name='flex flex align-center justify-center payChangecode_flex_password_2'>
			<template #default="{ content, active, index }">
				<view :key="index" v-if="active"
					class="flex align-center justify-center active-digital-password payChangecode_flex_password_active_2">
					{{ content }}
				</view>
				<view :key="index" v-else class="flex align-center justify-center payChangecode_flex_password_active_2">
					{{ content }}
				</view>
			</template>
		</benben-digital-password>
		<!---flex布局flex布局开始-->
		<view class="flex flex-direction flex-wrap align-stretch justify-center benben-flex-layout">
			<view class='flex flex-wrap align-center justify-center'>
				<benben-send-verification-code class='flex  payChangecode_fd3_0_c0' after-text='后重新获取'
					before-text='获取验证码' :type='type' :phone="phone" :area_code="list"></benben-send-verification-code>
			</view>
			<button class='payChangecode_fd3_1' @tap.stop="changeBingDingPhoneFunc()">下一步</button>
		</view>

		<!---flex布局flex布局结束-->


	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	import back from "@/components/back/index.vue"
	import person from "@/components/person/index.vue"
	export default {
		components: {
			back,
			person
		},


		data() {
			return {
				"phone": "",
				phone1: '',
				"code": "",
				list: '',
				type: 7
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			// let a = uni.getStorageSync("USER_INFO")
			// console.log(a, 'aaa')
			// this.phone1 = a.mobile_hide
			// this.phone = a.mobile
			// this.list = a.area_code
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.getuser();
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//获取信息
			getuser() {
				this.$api.post(global.apiUrls.userinfo, {

				}).then(res => {
					// console.log(res);
					if (res.data.code == 1) {
						this.phone1 = res.data.data.mobile_hide;
						this.phone = res.data.data.mobile;
						this.list = res.data.data.area_code;
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
			//修改绑定手机号
			async changeBingDingPhoneFunc() {
				if (!validate(this.code, 'require')) {
					this.$message.info('验证码不能为空');
					return false;
				}
				let res = await this.$api.post(global.apiUrls.a643673025ef00, {
					mobile: this.phone,
					code: this.code,
					type: this.type,
					area_code: this.list
				})
				if (res.data.code != 1) {
					this.$message.info(res.data.msg)
					return
				}
				this.$urouter.navigateTo(
					`/pages/xtsz/newwithdrawalpaymentpassword/newwithdrawalpaymentpassword?type=&oldPayPwd=`);
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto !important;
	}

	.payChangecode_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.payChangecode_fd0_0_c2 {
		width: 32rpx;
		height: 32rpx;
	}

	.payChangecode_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.payChangecode_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333;
		line-height: 88rpx;
	}

	.payChangecode_fd0_0 {
		margin: 0rpx 32rpx 0rpx 32rpx;
	}

	.payChangecode_flex_1 {
		padding: 103rpx 0rpx 0rpx 0rpx;
	}

	.payChangecode_fd1_1 {
		margin: 51rpx 0rpx 71rpx 0rpx;
		line-height: 37rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: #484848;
	}

	.payChangecode_fd1_0 {
		font-size: 28rpx;
		font-weight: 400;
		color: #333333;
	}

	.payChangecode_flex_password_active_2 {
		border: 1px solid var(--benbenbdColor0);
		width: 100rpx;
		height: 100rpx;
	}

	::v-deep .payChangecode_flex_password_2 {
		margin: 24rpx 0rpx 24rpx 0rpx;
	}

	.payChangecode_fd3_1 {
		background: var(--benbenbgColor2);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		margin: 80rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
		line-height: 88rpx;
		width: 686rpx;
	}

	.payChangecode_fd3_0_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor4);
		text-align: center;
	}
</style>